package com.thread.example.second;

public class Main {
    public static void main(String[] args) {
        MyRunable myRunable = new MyRunable();
        //子线程1
        new Thread(myRunable).start();
        //主线程
        for(int i=100;i<200;i++){
            System.out.println("主线程2:"+i);
        }
        //子线程2
        new Thread(new MyRunable() {
            @Override
            public void run() {
               for(int i=200; i<300;i++){
                   System.out.println("子线程3:"+i);
               }
            }
        }).start();

        //子线程3
        new Thread(()->{
            for(int i=300;i<400;i++){
                System.out.println("子线程4:"+i);
            }
        }).start();
    }
}
